home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / c01lab4.zip / LRMRDR / LRM_CHAP.ZIP / CHAP01.DOC next >
Text File  |  1992-04-21  |  28KB  |  990 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. The following document is a draft  of  the  corresponding  chapter  of  the
  7. version  of  the  Ada  Reference  Manual  produced  in response to the Ansi
  8. Canvass.  It is given a limited circulation  to  Ada  implementers  and  to
  9. other groups contributing comments (according to the conventions defined in
  10. RRM.comments).  This draft should not be referred to in any publication.
  11.  
  12.  
  13.  
  14.                       ANSI-RM-01.v23 - Draft Chapter
  15.  
  16.                               1  Introduction
  17.                                 version 23
  18.  
  19.                                  83-02-11
  20.  
  21. This version has addressed comments up to #5795
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. >                               1. Introduction
  78.  
  79.  
  80.  
  81. Ada  is  a  programming  language  designed in accordance with requirements
  82. defined by the United States Department of Defense:  the so-called Steelman
  83. requirements.   Overall,  these  requirements  call  for  a  language  with
  84. considerable  expressive  power  covering  a wide application domain.  As a
  85. result, the language includes facilities  offered  by  classical  languages
  86. such  as  Pascal  as  well  as  facilities  often found only in specialized
  87. languages.  Thus the language is a modern  algorithmic  language  with  the
  88. usual  control  structures,  and  with  the  ability  to  define  types and
  89. subprograms.  It also serves the need for modularity, whereby data,  types,
  90. and  subprograms  can  be  packaged.   It treats modularity in the physical
  91. sense as well, with a facility to support separate compilation.
  92.  
  93. In addition to these aspects, the language  covers  real-time  programming,
  94. with  facilities to model parallel tasks and to handle exceptions.  It also
  95. covers  systems  programming;   this  requires  precise  control  over  the
  96. representation of data and access to system-dependent properties.  Finally,
  97. both application-level and machine-level input-output are defined.
  98.  
  99.  
  100.  
  101. > 1.1  Scope of the Standard
  102.  
  103.  
  104. This  standard  specifies  the form and meaning of program units written in
  105. Ada.  Its purpose is to promote  the  portability  of  Ada  programs  to  a
  106. variety of data processing systems.
  107.  
  108.  
  109.  
  110. > 1.1.1  Extent of the Standard
  111.  
  112.  
  113. This standard specifies:
  114.  
  115. (a)  The form of a program unit written in Ada.
  116.  
  117. (b)  The effect of translating and executing such a program unit.
  118.  
  119. (c)  The manner in  which  program  units  may  be  combined  to  form  Ada
  120.      programs.
  121.  
  122. (d)  The predefined program units that  a  conforming  implementation  must
  123.      supply.
  124.  
  125. (e)  The permissible variations within the  standard,  and  the  manner  in
  126.      which they must be specified.
  127.  
  128. (f)  Those violations of the standard that a conforming  implementation  is
  129.      required  to  detect,  and  the  effect  of attempting to translate or
  130.      execute a program unit containing such violations.
  131.  
  132. (g)  Those violations of the standard that a conforming  implementation  is
  133.      not required to detect.
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193. This standard does not specify:
  194.  
  195. (h)  The means whereby a program unit written in Ada  is  transformed  into
  196.      object code executable by a processor.
  197.  
  198. (i)  The means whereby translation or execution of program units is invoked
  199.      and the executing units are controlled.
  200.  
  201. (j)  The size or speed of the object code, or the relative execution  speed
  202.      of different language constructs.
  203.  
  204. (k)  The form or contents of any listings produced by implementations;   in
  205.      particular, the form or contents of error or warning messages.
  206.  
  207. (l)  The effect of executing a program unit  that  contains  any  violation
  208.      that a conforming implementation is not required to detect.
  209.  
  210. (m)  The size of a program or program unit that will exceed the capacity of
  211.      a particular conforming implementation.
  212.  
  213. Where  this  standard  specifies  that a program unit written in Ada has an
  214. exact effect, this effect is the operational meaning of  the  program  unit
  215. and  must  be  produced  by  all  conforming  implementations.   Where this
  216. standard specifies permissible variations in the effects of constituents of
  217. a program unit written in Ada, the operational meaning of the program  unit
  218. as  a  whole  is understood to be the range of possible effects that result
  219. from all these variations, and a conforming implementation  is  allowed  to
  220. produce  any of these possible effects.  Examples of permissible variations
  221. are:
  222.  
  223.   -  The represented values of fixed or floating  numeric  quantities,  and
  224.      the results of operations upon them.
  225.  
  226.   -  The order of execution of statements in different parallel  tasks,  in
  227.      the absence of explicit synchronization.
  228.  
  229.  
  230.  
  231. > 1.1.2  Conformity of an Implementation With the Standard
  232.  
  233.  
  234. A conforming implementation is one that:
  235.  
  236. (a)  Correctly translates and executes legal program units written in  Ada,
  237.      provided  that  they are not so large as to exceed the capacity of the
  238.      implementation.
  239.  
  240. (b)  Rejects all program units that are so large as to exceed the  capacity
  241.      of the implementation.
  242.  
  243. (c)  Rejects all program units  that  contain  errors  whose  detection  is
  244.      required by the standard.
  245.  
  246. (d)  Supplies all predefined program units required by the standard.
  247.  
  248. (e)  Contains no variations except where the standard permits.
  249.  
  250. (f)  Specifies all such permitted variations in the  manner  prescribed  by
  251.      the standard.
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313. > 1.2  Structure of the Standard
  314.  
  315.  
  316. This  reference  manual  contains  fourteen  chapters, three annexes, three
  317. appendices, and an index.
  318.  
  319. Each chapter is divided into sections that have a common  structure.   Each
  320. section  introduces  its  subject,  gives  any  necessary syntax rules, and
  321. describes the semantics of the corresponding language constructs.  Examples
  322. and notes, and then references, may appear at the end of a section.
  323.  
  324. Examples are meant to illustrate  the  possible  forms  of  the  constructs
  325. described.   Notes  are  meant  to  emphasize  consequences  of  the  rules
  326. described in the section or elsewhere.  References are meant to attract the
  327. attention of readers to a term or phrase having a technical meaning defined
  328. in another section.
  329.  
  330. The standard definition of the Ada programming  language  consists  of  the
  331. fourteen   chapters  and  the  three  annexes,  subject  to  the  following
  332. restriction:   the  material  in  each  of  the  items  listed   below   is
  333. informative, and not part of the standard definition of the Ada programming
  334. language:
  335.  
  336.   -  Section 1.3 Design goals and sources
  337.  
  338.   -  Section 1.4 Language summary
  339.  
  340.   -  The examples, notes, and references given at the end of each section
  341.  
  342.   -  Each section whose title starts with the word "Example" or  "Examples"
  343.  
  344.  
  345.  
  346. > 1.3  Design Goals and Sources
  347.  
  348.  
  349. Ada  was  designed with three overriding concerns:  program reliability and
  350. maintenance, programming as a human activity, and efficiency.
  351.  
  352. The need for languages that promote reliability and simplify maintenance is
  353. well established.  Hence emphasis was placed on  program  readability  over
  354. ease  of  writing.   For  example,  the  rules of the language require that
  355. program variables be explicitly declared and that their type be  specified.
  356. Since  the  type  of  a  variable  is  invariant, compilers can ensure that
  357. operations on variables are compatible with  the  properties  intended  for
  358. objects of the type.  Furthermore, error-prone notations have been avoided,
  359. and  the syntax of the language avoids the use of encoded forms in favor of
  360. more English-like constructs.  Finally, the  language  offers  support  for
  361. separate  compilation  of  program  units in a way that facilitates program
  362. development and maintenance, and which provides the same degree of checking
  363. between units as within a unit.
  364.  
  365. Concern for the human programmer  was  also  stres